package cn.aws360.boot.system.starter.config;

import cn.aws360.boot.system.api.pojo.properties.FileProperties;
import cn.aws360.boot.system.biz.helper.OssHelper;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * @author junnan
 */
@Configuration
@ComponentScan(basePackages = {"cn.aws360.boot.system.**"})
@MapperScan(basePackages = {"cn.aws360.boot.system.**.mapper"})
public class SysAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(FileProperties.class)
    public FileProperties fileProperties() {
        return new FileProperties();
    }

    @Bean
    @ConditionalOnMissingBean(OssHelper.class)
    public OssHelper ossHelper() {
        return new OssHelper(fileProperties());
    }

}
